<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2018/5/1
  Time: 21:30
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<!DOCTYPE html>
<html>
<script>
    if (window.top !== window.self) {
        window.top.location = window.location
    }
</script>
<head>
    <meta charset="UTF-8">
    <title>ལམ་ཐིག་སྟག་རིས་ཅན་ཆོ་རྒྱུགས་མ་ལག།藏文用户登陆</title>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/css/main.css">
    <style>
        body {
            margin: 0;
            background: url("/image/bg.jpg") no-repeat fixed;
            background-size: cover;
        }
        button{
            background: #00b7ee;
            border-radius: 5px;
            width: 100px;
            height: 40px;
        }

    </style>

</head>
<body>
<div class="container" style=""><br><br><br><br><br>
    <form action="${pageContext.request.contextPath}/user/login" id="myform" onsubmit='return LoginValid()' method="post">
        <div class="login-div"><br><br>
            <div class="login-title">སྤྱོད་མཁན་ར་འཛེག།</div>
            <div class="login-title">考试登陆</div>
            <br>
            <div class="login-input">
                <input type="text" name="name">
            </div>
            <div class="login-input">
                <input type="password" name="pwd">
            </div>
            <input type="hidden" name="type" value="2">
            <span style="display:block;width:auto;text-align:center;color: red">${msg}</span>
            <span style="display:block;width:auto;text-align:center;color: red" id="sssss">${s}</span>
            <button class="login-btn" style="width: 200px">སྐམ་འབེབས་མ་ལག།  登陆</button>
            <div class="login-btn">
                <a href="/p/user/login" style="text-decoration: underline">汉字登陆入口</a>
            </div>
        </div>
    </form>
</div>
</body>
<script src="${pageContext.request.contextPath}/static/js/jquery.min.js"></script>
<script src="${pageContext.request.contextPath}/static/layer/layer.js"></script>
<script type="text/javascript" language=JavaScript charset="UTF-8">

    function Login() {
        var $form = $("#myform");
        $form.submit();
    }

    function LoginValid() {
        var Utel = $('input[name=name]').val();
        var Upass = $('input[name=pwd]').val();
        if (!Utel) {
            layer.msg('ཁྱེད་ཀྱི་ཚད་ཁ་པར་ཨང་གྲངས།', {icon: 2, time: 1000});
            $('input[name=Utel]').focus();
            return false;
        }
        if (!Upass) {
            layer.msg('ཁྱེད་ཀྱི་ཚད་ར་འཛེག་ཨང་ཡིག།', {icon: 2, time: 1000});
            $('input[name=Upass]').focus();
            return false;
        }

    }


    document.onkeydown = function (event) {
        var e = event || window.event || arguments.callee.caller.arguments[0];
        if (e && e.keyCode == 13) { // enter 键
            Login();
        }
    };
</script>
</html>
